// node_js/image_mixer.js

app.registerExtension({
  name: "ImageLatentMixerSlider",
  init() {},
  nodeCreated(node) {
    if (node.type === "ImageLatentMixer") {
      const widget = node.addWidget("slider", "mix_factor", node.widgets_values[0] || 0.5, (val) => {
        // Update value when changed
        node.widgets_values[0] = val;
      }, {
        min: 0,
        max: 1,
        step: 0.01,
        precision: 2
      });

      // Optional: Label the slider
      widget.label = "Mix Factor";
      widget.tooltip = "Blend between image1 and image2 latents";
    }
  }
});